package com.ld.security.auth.common.feign;


import com.ld.security.auth.common.base.entity.AuthUser;
import com.ld.security.auth.common.base.entity.JwtUser;
import com.ld.security.auth.common.base.entity.JwtUserInfo;
import com.ld.security.auth.common.base.po.FunctionPo;
import com.ld.security.auth.common.base.po.LoginPo;
import com.ld.security.auth.common.base.vo.FunctionVo;
import com.ld.security.auth.common.base.vo.TokenVo;
import com.ld.security.auth.common.po.UsernamePo;
import com.ld.security.auth.common.rpc.po.TokenPo;
import com.ld.security.common.core.base.vo.DataVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.Map;

@FeignClient(name =  "ld-auth-server")
@RequestMapping("/api/authUser")
public interface AuthUserFeign {

    @RequestMapping(value="/logout",method = RequestMethod.POST)
    DataVo logout(@RequestBody TokenPo po);


    @RequestMapping(value="/getJwtInfo",method = RequestMethod.POST)

    DataVo<JwtUserInfo> getJwtInfo(@RequestBody TokenPo po);

    @RequestMapping(value = "/login",method = RequestMethod.POST)
    DataVo<TokenVo> login(@RequestBody LoginPo po);

    @RequestMapping(value = "/accredit",method = RequestMethod.POST)
    DataVo<TokenVo> accredit(@RequestBody TokenPo po);


    @RequestMapping(value="/hasPermission",method=RequestMethod.POST)
    DataVo<FunctionVo> hasPermission(@RequestBody FunctionPo po);


    @RequestMapping(value="/findByUsername",method=RequestMethod.POST)
    DataVo<JwtUser> findByUsername(@RequestBody UsernamePo po);

    @RequestMapping(value="/findByUserInfo",method=RequestMethod.POST)
    DataVo<JwtUserInfo> findByUserInfo(@RequestBody UsernamePo po);


}
